package factory.a;

public class OperationFactory {

	public static AbstractOperation createOperation(String operatingType) {
		
		AbstractOperation operation = null;
		
		if ("plus".equals(operatingType)) {
			operation = new OperationPlus();
		} else if ("minus".equals(operatingType)) {
			operation = new OperationMinus();
		} else if ("mult".equals(operatingType)) {
			operation = new OperationMultiplication();
		} else if ("devision".equals(operatingType)) {
			operation = new OperationDevision();
		} else {
			throw new RuntimeException("不支持的运算类型!");
		}
		
		return operation;
	}
	
}
